🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / feature / map / src / commonMain / kotlin / org / meshtastic / feature / map / layers / MapLayerStorage.kt
Displaying Raw • Download
feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/layers/MapLayerStorage.kt renovate/fastlane-2.x-lockfile (056eed64) Text, 2.52 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.feature.map.layers
Tff7b72import T7ee787okio.FileSystem
Tff7b72import T7ee787okio.Path
T8b949e/**
* Where imported layer files are kept for this platform.
*
* Imports are copied here rather than read from wherever the user picked them: the source may be a `content://` the app
* has no lasting permission for, or a file the user later moves. The copy is what the layer list persists — the
* directory listing *is* the layer list on restart.
*/
Tff7b72expect Tff7b72fun Td2a8ffmapLayersDirectoryTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3Path
T8b949e/**
* The file system layers are stored on.
*
* `FileSystem.SYSTEM` is not part of Okio's common API surface — it is declared per platform — so it is reached through
* expect/actual, the same way `core:database` reaches it.
*/
Tff7b72expect Tff7b72fun Td2a8ffmapLayerFileSystemTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3FileSystem
T8b949e/**
* Where converted copies of imported layers are cached (KML rendered down to GeoJSON, for the renderer that has no KML
* source). Disposable, unlike [mapLayersDirectory] — losing it only costs a reconversion.
*/
Tff7b72expect Tff7b72fun Td2a8ffmapLayersCacheDirectoryTb4b4b4(Tb4b4b4)Tb4b4b4: Te6edf3Path
T8b949e/**
* A file the user picked, handed to [MapLayersManager] by whatever picker the platform uses.
*
* The indirection is what makes the layer store common. Android resolves a `content://` through a ContentResolver and
* desktop opens a plain path; neither detail belongs in the store, so the caller does the resolving and passes the
* bytes behind [read].
*/
Tff7b72class T56d364PickedMapFileTb4b4b4(
T8b949e/** The name to show, and the base of the on-disk file name. Untrusted — see [layerFileName]. */
Tff7b72val Te6edf3displayNameTb4b4b4: Tffa657StringTb4b4b4,
T8b949e/** File extension or MIME subtype, resolved to a [LayerType] by [resolveLayerType]. */
Tff7b72val Te6edf3extensionOrMimeTb4b4b4: Tffa657String?Tb4b4b4,
T8b949e/** Reads the picked file. Null if it could not be opened, which is reported and skipped rather than thrown. */
Tff7b72val Te6edf3readTb4b4b4: Te6edf3suspend Tb4b4b4(Tb4b4b4) Tff7b72-Tff7b72> Te6edf3ByteArray?Tb4b4b4,
Tb4b4b4)
Served by rngit 1.5.2 - Generated in 0.04s